package com.lancoo.ccas53.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lancoo.ccas53.entity.Room;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lancoo.ccas53.config.MybatisRedisCache;
import com.lancoo.ccas53.pojo.dto.ArrangeRoomDto;
import com.lancoo.ccas53.pojo.vo.AllScheduleVo;
import com.lancoo.ccas53.pojo.vo.RoomWithRuleVo;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

/**
 * <p>
 * 教室 Mapper 接口
 * </p>
 *
 * @author quin.song
 * @since 2024-05-20
 */
@CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class)
public interface RoomMapper extends BaseMapper<Room> {

    int addBatch(@Param("roomCollection") Collection<Room> roomCollection);

    List<Room> getBuildingList(Integer taskId, Integer campusId);

    List<Integer> getBuildingFloor(Integer taskId, Integer campusId, Integer buildingId);

    List<Room> getRoomType(Integer taskId, Integer campusId, Integer buildingId, Integer floor);

    IPage<RoomWithRuleVo> getRoomListWithRule(IPage<RoomWithRuleVo> page, Integer taskId, Integer campusId, Integer buildingId, Integer floor, Integer roomType, String keyword, String baseCollegeId, Integer dataRange);

    List<ArrangeRoomDto> getArrangeRoom(Integer taskId, String schoolId, String term, String campusId);

    List<Room> getCollegeRoom(Integer taskId, String baseCollegeId, String keyword);

    int updateRoomList(Integer taskId);

    IPage<AllScheduleVo> getAllRoomPage(Page<AllScheduleVo> page, Integer taskId, Integer campusId, Integer buildingId, String keyword);

    List<Room> getRoomListByBuilding(Integer taskId, Integer campusId, Integer buildingId);

    List<Long> getAllRoomId(Integer taskId);

    void updateByType(Integer typeId);

    List<Long> getCurrentRoom(Integer taskId);

    List<Room> getBuildingListV2(Integer taskId);

}
